class DtListModel {
  int id;
  String text;
  List<String> img;
  String video;
  int uid;
  int dtType;
  int examine;
  String createtime;
  int memberFollow;
  int comcount;
  String memberNickname;
  String memberHead;
  String memberToken;
  List<Comment> comment;
  int type;

  DtListModel(
      {this.id,
      this.text,
      this.img,
      this.video,
      this.uid,
      this.dtType,
      this.examine,
      this.createtime,
      this.memberFollow,
      this.comcount,
      this.memberNickname,
      this.memberHead,
      this.memberToken,
      this.comment,
      this.type});

  DtListModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    text = json['text'];
    if (json['img'] != null) {
      img = json['img'].cast<String>();
    }
    video = json['video'];
    uid = json['uid'];
    dtType = json['dt_type'];
    examine = json['examine'];
    createtime = json['createtime'];
    memberFollow = json['member_follow'];
    comcount = json['comcount'];
    memberNickname = json['member_nickname'];
    memberHead = json['member_head'];
    memberToken = json['member_token'];
    if (json['comment'] != null) {
      comment = new List<Comment>();
      json['comment'].forEach((v) {
        comment.add(new Comment.fromJson(v));
      });
    }
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['text'] = this.text;
    data['img'] = this.img;
    data['video'] = this.video;
    data['uid'] = this.uid;
    data['dt_type'] = this.dtType;
    data['examine'] = this.examine;
    data['createtime'] = this.createtime;
    data['member_follow'] = this.memberFollow;
    data['comcount'] = this.comcount;
    data['member_nickname'] = this.memberNickname;
    data['member_head'] = this.memberHead;
    data['member_token'] = this.memberToken;
    if (this.comment != null) {
      data['comment'] = this.comment.map((v) => v.toJson()).toList();
    }
    data['type'] = this.type;
    return data;
  }
}


class Comment {
  int id;
  int uid;
  int dtid;
  String createtime;
  int pid;
  String text;
  String parentName;
  String memberNickname;
  String memberHead;

  Comment(
      {this.id,
      this.uid,
      this.dtid,
      this.createtime,
      this.pid,
      this.text,
      this.parentName,
      this.memberNickname,
      this.memberHead});

  Comment.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    uid = json['uid'];
    dtid = json['dtid'];
    createtime = json['createtime'];
    pid = json['pid'];
    text = json['text'];
    parentName = json['parent_name'];
    memberNickname = json['member_nickname'];
    memberHead = json['member_head'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['uid'] = this.uid;
    data['dtid'] = this.dtid;
    data['createtime'] = this.createtime;
    data['pid'] = this.pid;
    data['text'] = this.text;
    data['parent_name'] = this.parentName;
    data['member_nickname'] = this.memberNickname;
    data['member_head'] = this.memberHead;
    return data;
  }
}
